from 新版2.系统组件.消息队列 import RabbitMQTickSubscriber
import json
if __name__ == "__main__":
    # 订阅者示例
    def process_tick(ch, method, properties, body):
        tick = json.loads(body)
        print(f" [x] Received tick: {tick}")


    print("\nStarting subscriber...")
    subscriber = RabbitMQTickSubscriber(process_tick)
    try:
        subscriber.start_consuming()
    except KeyboardInterrupt:
        subscriber.close()
        print("Subscriber stopped")